package com.hl.util;

import java.sql.Connection;
import java.sql.DriverManager;

public class DBHelper {
	public static final String url = "jdbc:mysql://localhost:3306/wifiServer";  
	public static final String name = "com.mysql.jdbc.Driver";  
	public static final String user = "root";  
	public static final String password = "root";  

	public static Connection conn = null;  

	
	public Connection getConnection() {
		try {  
			Class.forName(name);//指定连接类型  
			conn = (Connection) DriverManager.getConnection(url,user,password);//获取连接  
		} catch (Exception e) {  
			e.printStackTrace();  
		}  
		return conn;
	}
}
